Skip to content

fix(core): avoid recompiling on Git index changes - #2080

Open
willwashburn wants to merge 1 commit into
mainfrom
codex/core-build-watch-inputs
Open

willwashburn wants to merge 1 commit into
mainfrom
codex/core-build-watch-inputs

Conversation

@willwashburn

@willwashburn willwashburn commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Touching the builder checkout’s Git index currently reruns agent-relay-node’s build script and recompiles the core and its consumers, although the index does not affect any embedded metadata. Watch only HEAD and its active ref, preserving correct revision changes for branch and detached checkouts.

The regression test compiles and executes the real build script against a temporary external Git checkout. It covers staging-only changes, commits on a branch and detached HEAD, and explicit release versions that bypass development changelog parsing. It rejects the original index watcher.

Validation:

  • Standalone build-script regression test passes; rustfmt and git diff checks pass.
  • Cargo --timings and fingerprint logging confirm the original invalidation path: .git/index → public node library → private desktop library → executable.

Controlled local release benchmark (macOS, Rust 1.95.0, CARGO_INCREMENTAL=0, --locked --offline --release --timings, fixed version 2026.11.999):

Input change Before After Recompiled after
Touch only builder .git/index 78.693s 0.317s None (272 fresh artifacts)
No input change 0.441s (original Git dependency) 0.148s None

The before/after index measurements use the same local dependency path, target directory, desktop snapshot 17c4b47d3b507b74632a415e95d49b79aae1931a, and public source 31eac487; only this build-script patch differs, with a seed build before each measurement. The desktop snapshot is an in-flight review tree, not landed main. The original Git dependency independently reproduced the index-only rebuild in 65.813s. These are single-run diagnostic measurements; host load varies. This is a local warm-build improvement, not a measured fresh-run CI release speedup. No runtime behavior or metadata contract changes.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T16:34:18.855440Z 27c9e85 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The build script no longer watches the Git index for Cargo rebuilds. It continues to watch HEAD and the active branch ref. An integration test checks watch paths and build metadata during staging, commits, release overrides, and detached-HEAD builds.

Changes: Git build inputs

Layer / File(s) Summary
Update and verify Git watch inputs
crates/relay-node/build.rs, crates/relay-node/tests/build_watch_inputs.rs, .agentworkforce/trajectories/codex-build-watch/completed/2026-11/traj_hynv0vdcl7gp/*
The build script watches HEAD and, when attached, the symbolic branch ref. It no longer watches the Git index. Integration tests check development and release outputs and watch paths across staging, commits, and detached HEAD. The trajectory records the change and reported local results.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to 27c9e

No actionable merge-blocking risk is established. The change avoids staging-only rebuilds while retaining revision tracking; it is mergeable subject to normal checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description provides a detailed summary and validation results, but it omits the required Test Plan and RelayFlow Proof sections. It also does not include the required change type and RelayFlow ca… Add the required sections from the repository template. Include a Test Plan with checked or unchecked test and manual-testing items. Add RelayFlow Proof with Change type set to non-functional and RelayFlow case set to n/a, because runti…
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preventing recompilation when the Git index changes.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description provides a detailed summary and validation results, but it omits the required Test Plan and RelayFlow Proof sections. It also does not include the required change type and RelayFlow case values.

Resolution

Add the required sections from the repository template. Include a Test Plan with checked or unchecked test and manual-testing items. Add RelayFlow Proof with Change type set to non-functional and RelayFlow case set to n/a, because runtime behavior is unchanged. Add a Screenshots section with N/A if applicable.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 2 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the build's watch list,
The index rests, no longer called.
HEAD still points, the branch ref follows,
A commit stamps a fresh revision.
Tests hop through staging, release, and detach,
Then tuck the report into the burrow.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6fe8e52a-634c-4bd0-a312-96455a2489fa
Commits

Reviewing files that changed from the base of the PR and between ad983d7 and 27c9e85.

Files selected for processing: 4
  • .agentworkforce/trajectories/codex-build-watch/completed/2026-11/traj_hynv0vdcl7gp/summary.md
  • .agentworkforce/trajectories/codex-build-watch/completed/2026-11/traj_hynv0vdcl7gp/trajectory.json
  • crates/relay-node/build.rs
  • crates/relay-node/tests/build_watch_inputs.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Removes the Git index watch from crates/relay-node/build.rs without changing how versions or revisions are set.

  • Staging changes no longer trigger unnecessary rebuilds.

Reviews (1) · Last reviewed commit: "fix(core): avoid recompiling on Git inde..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 4 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".agentworkforce/trajectories/codex-build-watch/completed/2026-11/traj_hynv0vdcl7gp/trajectory.json">

<violation number="1" location=".agentworkforce/trajectories/codex-build-watch/completed/2026-11/traj_hynv0vdcl7gp/trajectory.json:7">
P2: This completed trajectory is missing its generated `.trace.json` companion. Run the completion/finalization flow that emits the raw trace rather than committing only the summary and trajectory snapshot.</violation>

<violation number="2" location=".agentworkforce/trajectories/codex-build-watch/completed/2026-11/traj_hynv0vdcl7gp/trajectory.json:45">
P2: This completed trajectory omits the implementation commit and every changed path, so its audit record cannot identify the work it completed. Regenerate the completed trajectory metadata after recording the implementation commit instead of leaving `commits` and `filesChanged` empty.

(Based on your team's feedback about complete trajectory trace metadata.) [70713d7e-b5b6-4c02-88cf-a284a308fd60]</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

"task": {
"title": "Avoid rebuilding native core when Git index changes"
},
"status": "completed",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This completed trajectory is missing its generated .trace.json companion. Run the completion/finalization flow that emits the raw trace rather than committing only the summary and trajectory snapshot.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .agentworkforce/trajectories/codex-build-watch/completed/2026-11/traj_hynv0vdcl7gp/trajectory.json, line 7:

<comment>This completed trajectory is missing its generated `.trace.json` companion. Run the completion/finalization flow that emits the raw trace rather than committing only the summary and trajectory snapshot.</comment>

<file context>
@@ -0,0 +1,53 @@
+  "task": {
+    "title": "Avoid rebuilding native core when Git index changes"
+  },
+  "status": "completed",
+  "startedAt": "2026-11-04T16:29:37.671Z",
+  "completedAt": "2026-11-04T16:32:57.025Z",
</file context>

"approach": "Standard approach",
"confidence": 0.95
},
"commits": [],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This completed trajectory omits the implementation commit and every changed path, so its audit record cannot identify the work it completed. Regenerate the completed trajectory metadata after recording the implementation commit instead of leaving commits and filesChanged empty.

(Based on your team's feedback about complete trajectory trace metadata.) [70713d7e-b5b6-4c02-88cf-a284a308fd60]

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .agentworkforce/trajectories/codex-build-watch/completed/2026-11/traj_hynv0vdcl7gp/trajectory.json, line 45:

<comment>This completed trajectory omits the implementation commit and every changed path, so its audit record cannot identify the work it completed. Regenerate the completed trajectory metadata after recording the implementation commit instead of leaving `commits` and `filesChanged` empty.

(Based on your team's feedback about complete trajectory trace metadata.) [70713d7e-b5b6-4c02-88cf-a284a308fd60]</comment>

<file context>
@@ -0,0 +1,53 @@
+    "approach": "Standard approach",
+    "confidence": 0.95
+  },
+  "commits": [],
+  "filesChanged": [],
+  "projectId": "AgentWorkforce/relay",
</file context>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant